package quickSortMediana3;
import static org.junit.Assert.*;
import quickSortMediana3.*;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;


/**
 * Classe de teste para a implementacao do algoritmo de quicksort mediana de 3.
 * @author betinho
 *
 */
public class TestQuicksortMedianThree {

	Quick q1 = new Quick();
	
 
	private int[] array1 = {14,28,1,6,9,4,18,7,3,21,2,17,25,15,19,8,16,38,0,29};
	private int[] array2 = {38,29,17,6,9,4,25,7,3,21,2,1,14,18,15,19,8,16,28,0};
	private int[] arrayOrdenado = {0,1,2,3,4,6,7,8,9,14,15,16,17,18,19,21,25,28,29,38};
	
	@Before
	public void setUp() throws Exception {
		
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void quickSortMedian3() {
		
		Assert.assertArrayEquals(arrayOrdenado, q1.quickSortMedia3(array1, 0, array1.length - 1));
		Assert.assertArrayEquals(arrayOrdenado, q1.quickSortMedia3(array2, 0, array1.length - 1));
	}

}